package com.dreamcar.auction.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ComponentCarRelationId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ComponentCarRelationId implements java.io.Serializable {

	// Fields

	private Integer idComponent;
	private Integer idCarModel;

	// Constructors

	/** default constructor */
	public ComponentCarRelationId() {
	}

	/** full constructor */
	public ComponentCarRelationId(Integer idComponent, Integer idCarModel) {
		this.idComponent = idComponent;
		this.idCarModel = idCarModel;
	}

	// Property accessors

	@Column(name = "id_component", nullable = false)
	public Integer getIdComponent() {
		return this.idComponent;
	}

	public void setIdComponent(Integer idComponent) {
		this.idComponent = idComponent;
	}

	@Column(name = "id_car_model", nullable = false)
	public Integer getIdCarModel() {
		return this.idCarModel;
	}

	public void setIdCarModel(Integer idCarModel) {
		this.idCarModel = idCarModel;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ComponentCarRelationId))
			return false;
		ComponentCarRelationId castOther = (ComponentCarRelationId) other;

		return ((this.getIdComponent() == castOther.getIdComponent()) || (this
				.getIdComponent() != null
				&& castOther.getIdComponent() != null && this.getIdComponent()
				.equals(castOther.getIdComponent())))
				&& ((this.getIdCarModel() == castOther.getIdCarModel()) || (this
						.getIdCarModel() != null
						&& castOther.getIdCarModel() != null && this
						.getIdCarModel().equals(castOther.getIdCarModel())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getIdComponent() == null ? 0 : this.getIdComponent()
						.hashCode());
		result = 37
				* result
				+ (getIdCarModel() == null ? 0 : this.getIdCarModel()
						.hashCode());
		return result;
	}

}